package com.lwj.liwanjia.adapter;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;

import com.lwj.liwanjia.R;
import com.lwj.liwanjia.bean.RegisterJiLuBean;

import java.util.List;

/**
 * Created by 001 on 2017/9/11.
 */

public class RegisterJiLuAdapter extends BaseAdapter {

    private Context mContext;
    private List<RegisterJiLuBean> mList;

    public RegisterJiLuAdapter(Context mContext,List<RegisterJiLuBean> mList) {
        this.mContext = mContext;
        this.mList = mList;
    }

    @Override
    public int getCount() {
        return mList.size();
    }

    @Override
    public Object getItem(int position) {
        return mList.get(position);
    }

    @Override
    public long getItemId(int position) {
        return position;
    }

    @Override
    public View getView(int position, View convertView, ViewGroup parent) {

        if (convertView == null) {
            convertView = LayoutInflater.from(mContext).inflate(R.layout.adapter_register_ji_lu, parent, false);
        }

        RegisterJiLuBean bean = mList.get(position);

        TextView tv_name = (TextView) convertView.findViewById(R.id.tv_name);
        TextView tv_time = (TextView) convertView.findViewById(R.id.tv_time);
        TextView tv_phone = (TextView) convertView.findViewById(R.id.tv_phone);

        tv_name.setText(bean.name);
        tv_time.setText(bean.time);
        tv_phone.setText(bean.phone);

        return convertView;
    }

}
